Fix: throw error when dbAdapter is missing (closes #967)#970
Open
divyanshsaraswat wants to merge 1 commit into
Open
Fix: throw error when dbAdapter is missing (closes #967)#970divyanshsaraswat wants to merge 1 commit into
divyanshsaraswat wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
While working with Hoodie, I noticed that if the dbAdapter option is missing or undefined (and you aren't using an external dbUrl or inMemory mode), the application can crash or fail with obscure errors later in the initialization process.
Current Behavior
Currently, the CLI does not validate that a dbAdapter is explicitly present if other database options are missing. This can lead to runtime errors when the application attempts to use the undefined adapter.
Expected Behavior
The application should check for a valid dbAdapter configuration during startup and throw a clear, descriptive error message if it is missing, guiding the user to fix their configuration.
Proposed Solution
I’ve implemented a fix in my fork that:
Fork comparison: Link to the fork
I’d like to open a pull request if this approach looks good.